//Page Object
import{ request }from "../../request/index"
Page({
  data: {
    // 轮播图数据
    swiperList: [],
    // 导航菜单
    cateList: [],
    floorList: []
  },
  //页面开始加载， 就会触发
  onLoad: function (options) {
    // 1 发送异步请求 获取轮播数据
    this.getCateList();
    this.getSwiperList();
    this.getFloorList();
  },
  getSwiperList(){
    request({url:'/home/swiperdata'}).then(res=>{
     
      this.setData({
        swiperList:res
      })
    })
  },

  getCateList() {
      request({url:'/home/catitems'}).then(res=>{
        this.setData({
          cateList:res
        })
      })
     
    
  },
  getFloorList(){
    request({url:'/home/floordata'}).then(res=>{
      console.log(res)
      this.setData({
        floorList:res
      })
    })
  },

  //item(index,pagePath,text)
  onTabItemTap: function (item) {

  }
});